#include <iostream>
#include <vector>  //包含vector的头文件

using namespace std;

int main()
{
	//定义一个vector对象
	//vector<int> myvector;  //定义了一个专门存放整数的vector
	vector<string> myvector;
	vector<string> othervector;
	string str="hello";
	//存放数据到vector
	//myvector.assign(5,10);
	myvector.assign(3,str);
	othervector=myvector;
	//打印一下vector  传统C/C++循环的写法
	/* for(int i=0; i<myvector.size(); i++)
		cout<<i<<"  "<<myvector.at(i)<<endl; */
	
	//使用迭代器(指针)去遍历vector
	//定义一个迭代器对象
	vector<string>::iterator myit=myvector.begin();
	for(myit=myvector.begin(); myit!=myvector.end(); myit++)
		cout<<*myit<<endl;
	
	for(myit=othervector.begin(); myit!=othervector.end(); myit++)
		cout<<*myit<<endl;
}